<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>V-for</title>
    <link rel="stylesheet" href="for.css">
    <script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="vue-app">
    <h1>v-for 循环</h1>

    <!--数组下标-->
    <!--{{cha[0]}}
    {{cha[1]}}
    {{cha[2]}}-->
    <!--数组遍历-->
    <ul>
        <li v-for="cha in chas">
            {{cha}}
        </li>
    </ul>

    <ul>
        <li v-for="(user,index) in users">
           {{index+1}}. {{user.name}} - {{user.age}}
        </li>
    </ul>

    <template v-for="(user,index) in users">
        <h3>{{index}} . {{user.name}}</h3>
        <p>Age . {{user.age}}</p>
    </template>

    <template v-for="(user,index) in users">
       <div v-for="(val,key) in user">
           <p>{{key}} - {{val}}</p>
       </div>
    </template>
</div>

<script src="for.js"></script>
</body>
</html>
<tbody v-for:="(item,index) in users" :key="index"></tbody>